// https://min.erkantv.cn:443/han/hanJuji

import {
	request
} from "@/utils/request.js";


// 筛选
export function newVideosList(pageNum, pageSize, tags) {
	return request({
		url: '/collection/orderLast',
		data: {
			pageNum: pageNum,
			pageSize: pageSize,
			tags: tags
		}
	});

}

// 随机短剧信息
export function newVideosUrl(page, usersId) {
	return request({
		url: '/collectionPlayUrl/last',
		data: {
			pageNum: page,
			pageSize: 10,
			userId: usersId
		}
	});

}

// 获取导航栏
export function newTagsIndex() {
	return request({
		url: '/collectionPlayTag/list',
	});

}
// 随机筛选短剧信息
export function collectionPlay(pageNum, pageSize, tags) {
	return request({
		url: '/collectionPlay/findAll',
		data: {
			pageNum: pageNum,
			pageSize: pageSize,
			tags: tags
		}
	});

}

// 模糊查询
export function searchByTitle(name, pageNum, pageSize) {
	return request({
		url: '/collectionPlay/search',
		data: {
			name: name,
			pageNum: pageNum,
			pageSize: pageSize

		}
	});

}

// 点赞与观看历史
export function findAllCountWatch(url, pageNum, pageSize, userId, videoId) {
	return request({
		url: url,
		data: {
			pageNum,
			pageSize,
			userId,
			videoId
		}
	});

}

//  观看记录删除
export function watchDelete(url, userId, urlId, videoId, Episode) {
	return request({
		url: url,
		data: {
			userId: userId,
			urlId: urlId,
			videoId: videoId,
			Episode: Episode
		}
	});

}
//  评论
export function playComments(pageNum, videoId) {
	return request({
		url: '/collectionPlayComment/list',
		data: {
			pageNum: pageNum,
			pageSize: 20,
			videoId: videoId
		}
	});

}
// 插入评论
export function insertCommend(videoId, username, userId, content, userImg) {
	return request({
		url: '/collectionPlayComment/insert',
		data: {
			videoId: videoId,
			username: username,
			userId: userId,
			content: content,
			userImg: userImg,
			time: new Date().getTime()
		}
	});

}


// 获取选中短剧的所有Url
export function PlayVideosUrl(userId, videoId) {
	return request({
		url: '/collectionPlayUrl/first',
		data: {
			pageNum: 1,
			pagesize: 200,
			userId: userId,
			videoId: videoId
		}
	});

}

// 更新观看记录
export function updadeVideosCreate(userId, urlId, videoId, Episode) {
	return request({
		url: '/collectionPlayWatch/update',
		data: {
			userId,
			urlId,
			videoId,
			Episode
		}
	});

}